/**
 *
 * @param {*} spped 数值越大速度越慢
 * @param {*} data 表格数据
 * @param {*} head 表头数据{lable:title文字,width:title宽度}
 */
function scroll(spped, data, head) {
  console.log($("#box"));
  let html_head = `<div class="head">`;
  head.forEach((head) => {
    html_head += `
            <span class="head-item" style="width:${head.width}px;">${head.lable}</span> 
            `;
  });
  html_head += `
                </div>
                <div class="scroll">
                    <ul id="scroll-body">    </ul>
                </div>
            `;
  $("#box").append(html_head);
  let html_content = "";
  data.forEach((v, i) => {
    console.log(v);

    html_content += `
          <li class="row">
                        <span class="row-item" style="">${i + 1}</span>
                        <span class="row-item" style="">${v.eq}</span>
                        <span class="row-item" style="">${v.zhenji}</span>
                        <span class="row-item" style="">${v.shendu}</span>
                        <span class="row-item" style="">${v.time}</span>
                    </li>
          `;
  });
  $("#scroll-body").append(html_content);
  $("#scroll-body").append(html_content);

  this.t1 = setInterval(() => {
    if (
      $("#scroll-body")[0].scrollTop >=
      $("#scroll-body")[0].scrollHeight / 2
    ) {
      $("#scroll-body")[0].scrollTop = 0;
    }
    $("#scroll-body")[0].scrollTop += 1;
  }, spped);
}
